package com.js.nickcar.entity.local;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * Created by LZY on 2017/6/20.
 */

public class Province implements Parcelable {

    private String name;
    private ArrayList<City> city;
    private int id;

    public ArrayList<City> getCity() {
        return city;
    }

    public void setCity(ArrayList<City> city) {
        this.city = city;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Province{" +
                "city=" + city +
                ", name='" + name + '\'' +
                ", id=" + id +
                '}';
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.name);
        dest.writeTypedList(this.city);
        dest.writeInt(this.id);
    }

    public Province() {
    }

    protected Province(Parcel in) {
        this.name = in.readString();
        this.city = in.createTypedArrayList(City.CREATOR);
        this.id = in.readInt();
    }

    public static final Creator<Province> CREATOR = new Creator<Province>() {
        @Override
        public Province createFromParcel(Parcel source) {
            return new Province(source);
        }

        @Override
        public Province[] newArray(int size) {
            return new Province[size];
        }
    };
}